<template>
	<view class="main">
		
		<navbar :isFixed="false" :isBack="false">
			<view class="logo" slot="navbar">
				<view class="logo-picdir">
					<image :src="baseImage + usual.logo" mode="" v-if="usual.logo"></image>
					<image :src="imgUrl + 'logo-white.png'" mode="" v-else></image>
				</view>
				<view class="logo-title">
					{{ usual.title }}
				</view>
			</view>
		</navbar>

		<view class="content">
			<view class="content-title">
				服务
			</view>
			<view class="content-view-box">
				<view class="content-view" @click="toUrl('/pages/web/service/share/zhengwufuwu')">
					<view class="content-view-data">
						<!-- <view class="content-view-label">
							政务服务
						</view>
						<view class="content-view-biref">
							就业创业社会保障在线办理链接
						</view>
						<view class="content-view-button">
							了解详情
						</view> -->
					</view>
					<view class="content-view-bj">
						<image :src="imgUrl + 'serveMainBj1.png'" mode="widthFix"></image>
					</view>
				</view>
				<view class="content-view" @click="toUrl('/pages/web/service/share/zhaopinhuodongList')">
					<view class="content-view-data">
						<!-- <view class="content-view-label">
							招聘活动
						</view>
						<view class="content-view-biref">
							大中小型招聘活动信息详情一览 
						</view>
						<view class="content-view-button">
							了解详情
						</view> -->
					</view>
					<view class="content-view-bj">
						<image :src="imgUrl + 'serveMainBj2.png'" mode="widthFix"></image>
					</view>
				</view>
			</view>
		</view>

		<view class="content-label">
			其他服务
		</view>

		<view class="item-box">
			<view class="item" @click="toUrl('/pages/web/service/share/list?cataName=集市活动')">
				<view class="item-data">
					<view class="item-icon">
						<image :src="imgUrl + 'serveMenuIcon1.png'" mode=""></image>
					</view>
					<view class="item-title">
						集市活动
					</view>
				</view>
			</view>
			<view class="item" @click="toUrl('/pages/web/service/share/site')">
				<view class="item-data">
					<view class="item-icon">
						<image :src="imgUrl + 'serveMenuIcon2.png'" mode=""></image>
					</view>
					<view class="item-title">
						服务站点
					</view>
				</view>
			</view>
			<view class="item" @click="toAppid('就业指导')">
				<view class="item-data">
					<view class="item-icon">
						<image :src="imgUrl + 'serveMenuIcon3.png'" mode=""></image>
					</view>
					<view class="item-title">
						就业指导
					</view>
				</view>
			</view>
			<view class="item" @click="toUrl('/pages/web/service/qiuzhiduan/skill')">
				<view class="item-data">
					<view class="item-icon">
						<image :src="imgUrl + 'serveMenuIcon4.png'" mode=""></image>
					</view>
					<view class="item-title">
						技能培训
					</view>
				</view>
			</view>
			<view class="item" @click="toUrl('/pages/web/service/qiuzhiduan/chuangyekongjian')">
				<view class="item-data">
					<view class="item-icon">
						<image :src="imgUrl + 'serveMenuIcon5.png'" mode=""></image>
					</view>
					<view class="item-title">
						创业空间
					</view>
				</view>
			</view>
			<view class="item" @click="toUrl('/pages/web/service/qiuzhiduan/consult')">
				<view class="item-data">
					<view class="item-icon">
						<image :src="imgUrl + 'serveMenuIcon6.png'" mode=""></image>
					</view>
					<view class="item-title">
						维权咨询
					</view>
				</view>
			</view>
			<view class="item" @click="toUrl('/pages/web/service/share/danye?cataName=带教服务')">
				<view class="item-data">
					<view class="item-icon">
						<image :src="imgUrl + 'serveMenuIcon7.png'" mode=""></image>
					</view>
					<view class="item-title">
						带教服务
					</view>
				</view>
			</view>
			<view class="item" @click="toUrl('/pages/web/service/share/danye?cataName=保险超市')">
				<view class="item-data">
					<view class="item-icon">
						<image :src="imgUrl + 'serveMenuIcon8.png'" mode=""></image>
					</view>
					<view class="item-title">
						保险超市
					</view>
				</view>
			</view>
		</view>

		<view class="main-bj">

		</view>
	</view>
</template>

<script>
	import Navbar from '@/components/Navbar.vue'
	import { mapState } from 'vuex'
	import {getCataOne} from "@/core/web-api/common.js"
	export default {
		data() {
			return {

			}
		},
		methods:{
			toUrl(url){
				uni.navigateTo({
					url
				})
			},
			toAppid(type){
				getCataOne({
					cataName:type
				}).then(res=>{
					if(res.code==20000){
						this.detail = res.data.detail;
						wx.navigateToMiniProgram({
							appId: res.data.detail.url,
							path: res.data.detail.path,
							extraData: {},
							envVersion: 'release', // 可选，指定环境版本
							success(res) {
								// 成功回调
							},
							fail(err) {
								// 失败回调
							}
						});

					}
				})
			}
		},
		computed:{
			...mapState(['imgUrl','usual','baseImage'])
		},
		components: {
			Navbar
		},
	}
</script>

<style scoped lang="less">
	.main {
		width: 100%;
		padding: 0 30upx;
		box-sizing: border-box;

		&-bj {
			width: 100%;
			height: 50vh;
			position: fixed;
			left: 0;
			top: 0;
			z-index: -1;
			background: linear-gradient(to bottom, #bdccfb, #f5f5f5);
		}

		&-button {
			width: 100%;
			position: fixed;
			background-color: #f5f5f5;
			left: 0;
			bottom: 0;
			padding: 10upx 30upx 0 30upx;
			text-align: center;
			font-size: 30upx;
			display: flex;

			view {
				height: 75upx;
				line-height: 75upx;
				border-radius: 10upx;
			}

			&-cancel {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 148upx;
				color: #666666;
				background-color: #fff;
				margin-right: 10upx;
			}

			&-confirm {
				width: 533upx;
				background: linear-gradient(to bottom, #5472fd, #6ca5fd);
				color: #ffffff;
				box-sizing: border-box;
			}
		}
	}

	.logo {
		display: flex;
		align-items: center;
		width: 100%;
		box-sizing: border-box;

		&-picdir {
			width: 66upx;
			height: 66upx;
			border-radius: 50%;

			image {
				width: 66upx;
				height: 66upx;
				border-radius: 50%;
			}
		}

		&-title {
			font-size: 26upx;
			color: #000000;
			margin-left: 15upx;
		}
	}

	.content {
		width: 100%;
		padding-top: 30upx;

		&-title {
			font-size: 38upx;
			color: #000000;
			font-weight: bold;
			text-align: center;
			letter-spacing: 10upx;
		}

		&-view {
			width: 330upx;
			height: 230upx;
			position: relative;
			border-radius: 30upx;
			padding: 40upx;
			box-sizing: border-box;
			 

			&-data {
				position: relative;
				z-index: 3;
				width: 150upx;
				
			}

			&-box {
				width: 100%;
				display: flex;
				justify-content: space-between;
				margin-bottom: 100upx;
				margin-top: 35upx;
			}

			&-bj {
				width: 330upx;
				height: 230upx;
				position: absolute;
				left: 0;
				top: 0;
				z-index: 1;

				image {
					width: 100%;
					height: 100%;
				}
			}

			&-label {
				font-size: 36upx;
				color: #ffffff;
				font-weight: bold;
			}

			&-biref {
				font-size: 18upx;
				color: #ffffff;
				margin-top: 5upx;
			}

			&-button {
				width: 128upx;
				height: 48upx;
				text-align: center;
				line-height: 48upx;
				border-radius: 10upx;
				background-color: #fff;
				color: #000000;
				font-size: 20upx;
				margin-top: 20upx;
			}
		}
	}

	.item {
		flex:1 0 50%; 
		&-box { 
			display: flex;
			flex-flow: wrap;  
		}
		&-data{
			width: 306upx;
			padding:33upx 0upx;
			// padding-right: 50upx;
			box-sizing: border-box;
			display: flex;
			justify-content: space-evenly;
			align-items: center;
			background-color: #fff;
			box-shadow: 0upx 0 30upx rgba(0,0,0,.15);
			margin:25upx auto;
			border-radius: 30upx;
			 
		}
		&-icon{
			width: 50upx;
			height: 50upx;
			image{
				width: 50upx;
				height: 50upx;
			}
		}
		&-title{
			font-size: 26upx;
			color: #4d4d4d;
		}
	}
</style>